package com.zhongan.gateway.service.impl;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.cache.annotation.CacheEvict;
import org.springframework.stereotype.Component;

import com.zhongan.gateway.service.CacheService;

@Component
public class CacheServiceImpl implements CacheService {

    @Override
    @CacheEvict(cacheNames = "apiCache", allEntries = true)
    public void clearApi() {
        LOG.info("clear apiCache...");
    }

    @Override
    @CacheEvict(cacheNames = "apiPrivilegeCache", allEntries = true)
    public void clearApiPrivilege() {
        LOG.info("clear apiPrivilegeCache...");
    }

    @Override
    @CacheEvict(cacheNames = "apiAttributeCache", allEntries = true)
    public void clearApiAttribute() {
        LOG.info("clear apiAttributeCache...");
    }

    @Override
    @CacheEvict(cacheNames = "developerCache", allEntries = true)
    public void clearDeveloper() {
        LOG.info("clearDeveloper...");
    }

    @Override
    @CacheEvict(cacheNames = "developerIpCache", allEntries = true)
    public void clearDeveloperIp() {
        LOG.info(" clearDeveloperIp...");
    }

    private static final Logger LOG = LoggerFactory.getLogger(CacheServiceImpl.class);

}
